<template>
  <!-- 相关检查 -->
    <el-form inline readonly>
      <el-divider content-position="left">验光信息</el-divider>
      <el-row class="bg-row">
        <el-form-item label="验光号">
          <el-input  v-model="checkData.checkNumber" readonly></el-input>
        </el-form-item>
        <el-form-item label="验光师">
          <el-input  v-model="checkData.checkerName" readonly></el-input>
        </el-form-item>
        <el-form-item label="日期">
          <el-input  v-model="checkData.checkDate" readonly></el-input>
        </el-form-item>
      </el-row>
      <el-divider content-position="left">顾客资料</el-divider>
      <el-row class="bg-row">
        <el-form-item label="卡号">
          <el-input v-model="customerData.customerCard"></el-input>
        </el-form-item>
        <el-form-item label="姓名">
          <el-input class="width-125"  v-model="customerData.name" readonly></el-input>
        </el-form-item>
        <el-form-item label="性别">
          <el-input class="width-125" v-if="customerData.gender == '0'" value="男" readonly></el-input>
          <el-input class="width-125" v-if="customerData.gender == '1'" value="女" readonly></el-input>
        </el-form-item>
        <el-form-item label="年龄">
          <el-input class="width-125"  v-model="customerData.age" readonly></el-input>
        </el-form-item>
        <el-form-item label="电话">
          <el-input class="width-125"  v-model="customerData.phone1" readonly></el-input>
        </el-form-item>
      </el-row>
      <el-divider content-position="left">特殊功能检查</el-divider>
      <!-- <el-row class="bg-row"> -->
        <table class="miui-table">
          <tr>
            <td width="50px"></td>
            <td>眼轴</td>
            <td>前房深</td>
            <td>晶状体厚度</td>
            <td>玻璃体腔长度</td>
            <td>角膜直径</td>
          </tr>
          <tr>
            <td>OD</td>
            <td><el-input v-model="dataForm.eyeAxisOd"><template slot="append">mm</template></el-input></td>
            <td><el-input v-model="dataForm.anteriorChamberDeepOd"><template slot="append">mm</template></el-input></td>
            <td><el-input v-model="dataForm.lensThicknessOd"><template slot="append">mm</template></el-input></td>
            <td><el-input v-model="dataForm.vitreousCavityLengthOd"><template slot="append">mm</template></el-input></td>
            <td><el-input v-model="dataForm.corneaDiameterOd"><template slot="append">mm</template></el-input></td>
          </tr>
          <tr>
            <td>OS</td>
            <td><el-input v-model="dataForm.eyeAxisOs"><template slot="append">mm</template></el-input></td>
            <td><el-input v-model="dataForm.anteriorChamberDeepOs"><template slot="append">mm</template></el-input></td>
            <td><el-input v-model="dataForm.lensThicknessOs"><template slot="append">mm</template></el-input></td>
            <td><el-input v-model="dataForm.vitreousCavityLengthOs"><template slot="append">mm</template></el-input></td>
            <td><el-input v-model="dataForm.corneaDiameterOs"><template slot="append">mm</template></el-input></td>
          </tr>
        </table>
      <!-- </el-row> -->
      <!-- <el-row class="bg-row" style="margin-top: 20px;"> -->
        <table class="miui-table">
          <tr>
            <td width="50px"></td>
            <td>角膜厚度</td>
            <td>角膜曲率(SK)</td>
            <td>角膜曲率(FK)</td>
          </tr>
          <tr>
            <td>OD</td>
            <td><el-input v-model="dataForm.cornealThicknessOd"><template slot="append">mm</template></el-input></td>
            <td>
              <el-row>
                <el-col :span="11"><el-input v-model="dataForm.corneaCurvatureOds1"></el-input></el-col>
                <el-col :span="2" style="text-align: center;">@</el-col>
                <el-col :span="11"><el-input v-model="dataForm.corneaCurvatureOds2"></el-input></el-col>
              </el-row>
            </td>
            <td>
              <el-row>
                <el-col :span="11"><el-input v-model="dataForm.corneaCurvatureOdf1"></el-input></el-col>
                <el-col :span="2" style="text-align: center;">@</el-col>
                <el-col :span="11"><el-input v-model="dataForm.corneaCurvatureOdf2"></el-input></el-col>
              </el-row>
            </td>
          </tr>
          <tr>
            <td>OS</td>
            <td><el-input v-model="dataForm.cornealThicknessOd"><template slot="append">mm</template></el-input></td>
            <td>
              <el-row>
                <el-col :span="11"><el-input v-model="dataForm.corneaCurvatureOds1"></el-input></el-col>
                <el-col :span="2" style="text-align: center;">@</el-col>
                <el-col :span="11"><el-input v-model="dataForm.corneaCurvatureOds2"></el-input></el-col>
              </el-row>
            </td>
            <td>
              <el-row>
                <el-col :span="11"><el-input v-model="dataForm.corneaCurvatureOdf1"></el-input></el-col>
                <el-col :span="2" style="text-align: center;">@</el-col>
                <el-col :span="11"><el-input v-model="dataForm.corneaCurvatureOdf2"></el-input></el-col>
              </el-row>
            </td>
          </tr>
        </table>
      <!-- </el-row> -->
      <!-- <el-row class="bg-row" style="margin-top: 20px;"> -->
        <table class="miui-table">
          <tr>
            <td :colspan="7">角膜地形图</td>
            <td :colspan="3">泪膜检测</td>
          </tr>
          <tr>
            <td width="50px"></td>
            <td>SK</td>
            <td>FK</td>
            <td>AST</td>
            <td>E值</td>
            <td>SAI</td>
            <td>SRI</td>
            <td>分级</td>
            <td>schirme5</td>
            <td>BUT</td>
          </tr>
          <tr>
            <td>OD</td>
            <td><el-input v-model="dataForm.topographySkOd"></el-input></td>
            <td><el-input v-model="dataForm.topographyFkOd"></el-input></td>
            <td><el-input v-model="dataForm.topographyAstOd"></el-input></td>
            <td><el-input v-model="dataForm.topographyeOd"></el-input></td>
            <td><el-input v-model="dataForm.topographySaiOd"></el-input></td>
            <td><el-input v-model="dataForm.topographySriOd"></el-input></td>
            <td><el-input v-model="dataForm.tearFilmGradeOd1"></el-input></td>
            <td><el-input v-model="dataForm.schirme5Od"><template slot="append">mm</template></el-input></td>
            <td><el-input v-model="dataForm.butOd"><template slot="append">s</template></el-input></td>
          </tr>
          <tr>
            <td>OS</td>
            <td><el-input v-model="dataForm.topographySkOs"></el-input></td>
            <td><el-input v-model="dataForm.topographyFkOs"></el-input></td>
            <td><el-input v-model="dataForm.topographyAstOs"></el-input></td>
            <td><el-input v-model="dataForm.topographyeOs"></el-input></td>
            <td><el-input v-model="dataForm.topographySaiOs"></el-input></td>
            <td><el-input v-model="dataForm.topographySriOs"></el-input></td>
            <td><el-input v-model="dataForm.tearFilmGradeOs1"></el-input></td>
            <td><el-input v-model="dataForm.schirme5Os"><template slot="append">mm</template></el-input></td>
            <td><el-input v-model="dataForm.butOs"><template slot="append">s</template></el-input></td>
          </tr>
        </table>
      <!-- </el-row> -->
      <el-divider content-position="left">角膜内皮细胞计数检查</el-divider>
      <!-- <el-row class="bg-row" style="margin-top: 20px;"> -->
        <table class="miui-table">
          <tr>
            <td width="50px"></td>
            <td>细胞密度</td>
            <td>平均细胞面积</td>
            <td>六边形细胞比例</td>
            <td>变异系数</td>
            <td>动态检影检查AST</td>
          </tr>
          <tr>
            <td>OD</td>
            <td><el-input v-model="dataForm.thicknessOd"><template slot="append">个/mm²</template></el-input></td>
            <td><el-input v-model="dataForm.areaOd"><template slot="append">um²</template></el-input></td>
            <td><el-input v-model="dataForm.scaleOd"><template slot="append">%</template></el-input></td>
            <td><el-input v-model="dataForm.variationOd"><template slot="append">%</template></el-input></td>
            <td><el-input v-model="dataForm.dynamicAdjustmentOd"></el-input></td>
          </tr>
          <tr>
            <td>OS</td>
            <td><el-input v-model="dataForm.thicknessOs"><template slot="append">个/mm²</template></el-input></td>
            <td><el-input v-model="dataForm.areaOs"><template slot="append">um²</template></el-input></td>
            <td><el-input v-model="dataForm.scaleOs"><template slot="append">%</template></el-input></td>
            <td><el-input v-model="dataForm.variationOs"><template slot="append">%</template></el-input></td>
            <td><el-input v-model="dataForm.dynamicAdjustmentOs"></el-input></td>
          </tr>
        </table>
      <!-- </el-row> -->
    </el-form>
</template>

<script>
  import { mapGetters } from 'vuex'
  import { filterParams } from '@/util/tools'
	import { addChkOptometryBasic, saveHealthCheckData, getHealthCheck } from '@/api/admin/optometry/optometry'

  export default {
    data() {
      return {
        visible: false,
        activeName: 'fourth',
				id: '',
        searchCustomerVisible: '',
        detailCustomerVisible: '',
        checkData: {
          checkNumber: '',
          checker: '',
          checkDate: ''
        },
        dataForm:{},
        chkDatas:[],
        customerData: {},
        checkList: [],
        optType: '',
        optOptions: [
          { value: '1', label: '远用' },
          { value: '2', label: '近用' },
          { value: '3', label: '渐进/双光' },
          { value: '4', label: '隐形' },
          { value: '5', label: '中用' },
          { value: '6', label: '角膜塑形' },
          { value: '7', label: '视觉训练' },
        ]
      }
    },
    components: {},
    computed: {
      ...mapGetters(['permissions', 'bizData', 'userInfo', 'isCollapse'])
    },
    methods: {
      init(data) {
        this.visible = true
        this.checkData = data.checkData
        this.customerData = data.customer
				this.id = data.billId
				this.$nextTick(() => {
					if(this.id){
						getHealthCheck(223619).then(response => {
							if(response.data.code == '0'){
							  this.dataForm = response.data.data
							}else{
							  this.$message.error(response.data.msg)
							}
						})
					}
				})
      }
    }
  }
</script>

<style lang="scss" scoped>
  .bg-row {
    // background-color: #cadee8;
    padding-left: 15px;
    padding-top: 5px;
  }
  .width-125 {
    width: 125px;
  }
  .miui-table {
    width: 100%;
    margin: 10px 0;
    background-color: #b1e2ec3b;
    tr th {
      background-color: #f4f5f7;
    }

    tr th, tr td {
      padding: 10px 8px;
      border: solid 1px #e7e7e7;
      text-align: center;
    }
    .miui-table-header td{
      background-color: #7898a8;
      color: #fff;
    }
    .miui-table-tbody{
      background-color: #cadee8;
    }
  }
</style>
